N2O valence (orbs 6 - 9) ePS results processing

22/02/24 PH

1st processing for N2O results.


For methods: https://epsproc.readthedocs.io/en/dev/demos/ePSproc_class_demo_161020.html

Setup

In [1]:
import sys
import os
from pathlib import Path
import numpy as np
# import epsproc as ep
import xarray as xr

import matplotlib.pyplot as plt

from datetime import datetime as dt
timeString = dt.now()

import epsproc as ep

# Plotters
from epsproc.plot import hvPlotters

# Multijob class dev code
from epsproc.classes.multiJob import ePSmultiJob

hvPlotters.setPlotters(width = 700, snsStyle='whitegrid')
* sparse not found, sparse matrix forms not available. 
* natsort not found, some sorting functions not available. 
* Setting plotter defaults with epsproc.basicPlotters.setPlotters(). Run directly to modify, or change options in local env.
* Set Holoviews with bokeh.
* pyevtk not found, VTK export not available. 
* Set Holoviews with bokeh.
In [2]:
# For class, above settings don't take, not sure why, something to do with namespaces/calling sequence?
# Overriding snsStyle does work however... although NOT CONSISTENTLY????
# AH, looks like ordering matters - set_style LAST (.set seems to override)
import seaborn as sns

sns.set(rc={'figure.figsize':(10,6)})  # Set figure size in inches
sns.set_context("paper")
sns.set_style("whitegrid")  # Set plot style
sns.set_palette("Paired")   # Set colour mapping

# Try direct fig type setting for PDF output figs
from IPython.display import set_matplotlib_formats
# set_matplotlib_formats('png', 'pdf')
set_matplotlib_formats('svg', 'pdf')
In [3]:
# xr.set_options(display_style='html')

Load data

In [4]:
import warnings
# warnings.filterwarnings('once')   # Skip repeated numpy deprecation warnings in current build (xr15 env)
warnings.filterwarnings('ignore')   # Skip repeated numpy deprecation warnings in current build (xr15 env)
In [5]:
# # Scan for subdirs, based on existing routine in getFiles()

# fileBase = Path('/home/paul/ePS/OCS/OCS_survey')  # Data dir on Stimpy

fileBase = Path('/home/paul/fock-mount/globalhome/eps/N2O/N2O_valence') # Data dir on Jake
In [6]:
# TODO: fix orb label here, currently relies on (different) fixed format

data = ePSmultiJob(fileBase, verbose = 0)

data.scanFiles()
data.jobsSummary()
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
Found 4 directories, with 16 files.

*** Job orb9_P details
Key: orb9_P
Dir /home/paul/fock-mount/globalhome/eps/N2O/N2O_valence/orb9_P, 4 file(s).
{   'batch': 'ePS N2O, batch N2O_valence, orbital orb9_P',
    'event': 'orb 9 (P/CAv) ionization, batch N2O_valence, None.',
    'orbE': -13.499568716634647,
    'orbLabel': 'P/CAv'}

*** Job orb6_S details
Key: orb6_S
Dir /home/paul/fock-mount/globalhome/eps/N2O/N2O_valence/orb6_S, 4 file(s).
{   'batch': 'ePS N2O, batch N2O_valence, orbital orb6_S',
    'event': 'orb 6 (S/CAv) ionization, batch N2O_valence, None.',
    'orbE': -22.60177741591763,
    'orbLabel': 'S/CAv'}

*** Job orb7_P details
Key: orb7_P
Dir /home/paul/fock-mount/globalhome/eps/N2O/N2O_valence/orb7_P, 4 file(s).
{   'batch': 'ePS N2O, batch N2O_valence, orbital orb7_P',
    'event': 'orb 7 (P/CAv) ionization, batch N2O_valence, None.',
    'orbE': -21.11331458826209,
    'orbLabel': 'P/CAv'}

*** Job orb8_S details
Key: orb8_S
Dir /home/paul/fock-mount/globalhome/eps/N2O/N2O_valence/orb8_S, 4 file(s).
{   'batch': 'ePS N2O, batch N2O_valence, orbital orb8_S',
    'event': 'orb 8 (S/CAv) ionization, batch N2O_valence, None.',
    'orbE': -19.00715329282262,
    'orbLabel': 'S/CAv'}
In [7]:
# Fix labels for plots
for key in data.data.keys():
    data.data[key]['jobNotes']['orbLabel'] = key
    
In [ ]:
 

System properties

Note orbital numbering in table below:

  • Orb is Gamess file output orbital numbering, ordered by energy but not grouped by degeneracy.
  • OrbGrp is grouped numbering by degeneracy, also used by ePolyScat, and will be used for labels etc. below.
In [8]:
data.molSummary()
*** Molecular structure
2024-02-21T13:45:11.628471 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
*** Molecular orbital list (from ePS output file)
EH = Energy (Hartrees), E = Energy (eV), NOrbGrp, OrbGrp, GrpDegen = degeneracies and corresponding orbital numbering by group in ePS, NormInt = single centre expansion convergence (should be ~1.0).
props Sym SymOrb EH Occ E NOrbGrp OrbGrp GrpDegen NormInt
orb
1 S 0.0 -20.6612 2.0 -562.219894 1.0 1.0 1.0 0.975090
2 S 0.0 -15.8503 2.0 -431.308635 1.0 2.0 1.0 0.975090
3 S 0.0 -15.7018 2.0 -427.267745 1.0 3.0 1.0 0.975090
4 S 0.0 -1.6338 2.0 -44.457963 1.0 4.0 1.0 0.975090
5 S 0.0 -1.4519 2.0 -39.508212 1.0 5.0 1.0 0.975090
6 S 0.0 -0.8306 2.0 -22.601777 1.0 6.0 1.0 0.975090
7 P 0.0 -0.7759 2.0 -21.113315 1.0 7.0 2.0 0.975090
8 P 0.0 -0.7759 2.0 -21.113315 2.0 7.0 2.0 0.999998
9 S 0.0 -0.6985 2.0 -19.007153 1.0 8.0 1.0 0.975090
10 P 0.0 -0.4961 2.0 -13.499569 1.0 9.0 2.0 0.975090
11 P 0.0 -0.4961 2.0 -13.499569 2.0 9.0 2.0 0.999998
*** Warning: some orbital convergences outside single-center expansion convergence tolerance (0.01):
[[ 7.  2.]
 [ 8.  2.]
 [10.  2.]
 [11.  2.]]

Plot cross-sections and betas

These are from ePolyScat's getCro function, and are LF (unaligned ensemble) results. This provides a good, if general, overview.

Overview (all symmetries, length gauge) vs. Eke

In [9]:
# NEED TO SET AGAIN AFTER CLASS IMPORT!
import warnings
# warnings.filterwarnings('once')   # Skip repeated numpy deprecation warnings in current build (xr15 env)
warnings.filterwarnings('ignore')   # Skip repeated numpy deprecation warnings in current build (xr15 env)
In [10]:
# Comparitive plot over datasets (all symmetries only)
Etype = 'Eke'  # Set for Eke or Ehv energy scale
pGauge = 'L'
# Erange=[0, 100]  # Plot range (full range if not passed to function below)
# data.plotGetCroComp(pType='SIGMA', Etype = Etype, Erange = Erange, backend = 'hv')
data.plotGetCroComp(pType='SIGMA', pGauge = pGauge, Etype = Etype)
2024-02-21T13:45:11.875721 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
In [11]:
# Comparative plot over datasets (all symmetries only)
data.plotGetCroComp(pType='BETA', Etype=Etype)
2024-02-21T13:45:12.300982 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/

Overview (all symmetries, length gauge) vs. Ehv

Same results as above, Ehv scale.

In [12]:
# Comparitive plot over datasets (all symmetries only)
Etype = 'Ehv'  # Set for Eke or Ehv energy scale
pGauge = 'L'
# Erange=[0, 100]  # Plot range (full range if not passed to function below)
# data.plotGetCroComp(pType='SIGMA', Etype = Etype, Erange = Erange, backend = 'hv')
data.plotGetCroComp(pType='SIGMA', pGauge = pGauge, Etype = Etype)
2024-02-21T13:45:12.626056 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
In [13]:
# Comparative plot over datasets (all symmetries only)
data.plotGetCroComp(pType='BETA', Etype=Etype)
2024-02-21T13:45:12.930132 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
In [14]:
# TODO
# data.plotGetCroComp(pType='BETA', Etype=Etype, backend='hv')

Checks

In [15]:
# Betas vs. Gauge
data.plotGetCro(pType='BETA', Etype=Etype)
2024-02-21T13:45:14.611178 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
2024-02-21T13:45:15.140664 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
2024-02-21T13:45:15.612566 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
2024-02-21T13:45:16.112480 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
In [ ]:
 

Versions

In [16]:
# print(data.jobInfo['ePolyScat'][0])
# print('Run: ' + jobInfo['Starting'][0].split('at')[1])
In [17]:
import scooby
scooby.Report(additional=['epsproc', 'xarray', 'jupyter'])
Out[17]:
Wed Feb 21 13:45:16 2024 EST
OS Linux CPU(s) 64 Machine x86_64
Architecture 64bit Environment Jupyter
Python 3.7.10 (default, Feb 26 2021, 18:47:35) [GCC 7.3.0]
epsproc 1.3.2-dev xarray 0.15.0 jupyter Version unknown
numpy 1.20.1 scipy 1.6.1 IPython 7.21.0
matplotlib 3.3.4 scooby 0.5.6
In [18]:
# Check current Git commit for local ePSproc version
!git -C {Path(ep.__file__).parent} branch
!git -C {Path(ep.__file__).parent} log --format="%H" -n 1
* dev
  master
998adf91c9279326be5b508c1b5df5737954157c
In [19]:
# Check current remote commits
!git ls-remote --heads https://github.com/phockett/ePSproc
c1eedf10631cb17fe33421427c195a2391369c37	refs/heads/3d-AFPAD-dev
897d73392a7b32ffba4ca6b6b4755c61e7c1c8d7	refs/heads/dependabot/pip/notes/envs/envs-versioned/certifi-2022.12.7
457f8cd85d89bd6474296b6c01e5165a4a7ce7fc	refs/heads/dependabot/pip/notes/envs/envs-versioned/cryptography-39.0.1
2855573d0f088b45d19acf2fd9a71eeb7af0a29b	refs/heads/dependabot/pip/notes/envs/envs-versioned/ipython-8.10.0
92c661789a7d2927f2b53d7266f57de70b3834fa	refs/heads/dependabot/pip/notes/envs/envs-versioned/mistune-2.0.3
fe1e9540c7b91fe571f60562acd31d8e489d491e	refs/heads/dependabot/pip/notes/envs/envs-versioned/nbconvert-6.5.1
70b80a1e3a54de91c2bfe3b6be82d611fcfd5f43	refs/heads/dependabot/pip/notes/envs/envs-versioned/pillow-9.3.0
92fc79b09aafedadcb645f88bb7ed771c96d5b52	refs/heads/dependabot/pip/notes/envs/envs-versioned/setuptools-65.5.1
fa33ed8d63a5c4a4043cc4c261059cc09e4c2bf7	refs/heads/dependabot/pip/notes/envs/envs-versioned/wheel-0.38.1
41cdfe43750e08c510f98b05e024a9c62da42771	refs/heads/dependabot/pip/setuptools-65.5.1
7e4270370d66df44c334675ac487c87d702408da	refs/heads/dev
1c0b8fd409648f07c85f4f20628b5ea7627e0c4e	refs/heads/master
69cd89ce5bc0ad6d465a4bd8df6fba15d3fd1aee	refs/heads/numba-tests
ea30878c842f09d525fbf39fa269fa2302a13b57	refs/heads/revert-9-master
baf0be0c962e8ab3c3df57c8f70f0e939f99cbd7	refs/heads/testDev

Env

In [20]:
!hostname
jake
In [21]:
!conda env list
# conda environments:
#
base                     /home/paul/anaconda3
automation               /home/paul/anaconda3/envs/automation
baseBK-250821            /home/paul/anaconda3/envs/baseBK-250821
baseBK-280321            /home/paul/anaconda3/envs/baseBK-280321
dataTests2022            /home/paul/anaconda3/envs/dataTests2022
ePSproc-v1.2             /home/paul/anaconda3/envs/ePSproc-v1.2
ePSproc-v1.2-dev         /home/paul/anaconda3/envs/ePSproc-v1.2-dev
epsTestConda             /home/paul/anaconda3/envs/epsTestConda
epsTestPip               /home/paul/anaconda3/envs/epsTestPip
epsTestPypi              /home/paul/anaconda3/envs/epsTestPypi
epsTestSetup             /home/paul/anaconda3/envs/epsTestSetup
epsdev                   /home/paul/anaconda3/envs/epsdev
epsdev-040821            /home/paul/anaconda3/envs/epsdev-040821
epsdev-040821-YMLnb      /home/paul/anaconda3/envs/epsdev-040821-YMLnb
epsdev-040821-YMLnb-bk     /home/paul/anaconda3/envs/epsdev-040821-YMLnb-bk
epsdev-0822              /home/paul/anaconda3/envs/epsdev-0822
epsdev-shared-100122     /home/paul/anaconda3/envs/epsdev-shared-100122
epsdev-xr13              /home/paul/anaconda3/envs/epsdev-xr13
epsdev-xr15           *  /home/paul/anaconda3/envs/epsdev-xr15
epsdev-xr17              /home/paul/anaconda3/envs/epsdev-xr17
epsdevTestYML            /home/paul/anaconda3/envs/epsdevTestYML
epsman                   /home/paul/anaconda3/envs/epsman
epsman-dev-shared-310122     /home/paul/anaconda3/envs/epsman-dev-shared-310122
fibre-sim                /home/paul/anaconda3/envs/fibre-sim
frog                     /home/paul/anaconda3/envs/frog
jbookTest                /home/paul/anaconda3/envs/jbookTest
jbookTestv2              /home/paul/anaconda3/envs/jbookTestv2
ldm                      /home/paul/anaconda3/envs/ldm
matlab                   /home/paul/anaconda3/envs/matlab
mfrecon090323            /home/paul/anaconda3/envs/mfrecon090323
qe-mini-example          /home/paul/anaconda3/envs/qe-mini-example
tmo-dev                  /home/paul/anaconda3/envs/tmo-dev

In [ ]: